import React from 'react'
import { render } from 'react-dom'
import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom'
import { Provider } from 'react-redux'

import { ConfigProvider } from 'antd'
import zhCN from 'antd/es/locale/zh_CN'

import App from './App'
import store from './store'
import { NotFound } from './views'

import './index.less'

render(
    <ConfigProvider locale={zhCN}>
        <Provider store={store}>
            <Router>
                <Switch>
                    <Route path="/graph" component={App} />
                    <Route path="/404" component={NotFound} />

                    <Redirect to="/graph" from="/" exact />
                    <Redirect to="/404" />
                </Switch>
            </Router>
        </Provider>
    </ConfigProvider>,
    document.querySelector("#root")
)
